<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>

<body>
  <div id="app">
    <input type="number" placeholder="请输入第一个数字" v-model="number1">
    <input type="number" placeholder="请输入第二个数字" v-model="number2">
    <button @click="getSum">求和</button>
    <p>
      两个输入框之和为 <span>{{sum}}</span>
    </p>
  </div>
  <script>
    Vue.createApp({
      data() {
        return {
          number1: '',
          number2: '',
          sum: 0
        }
      },
      methods:{
        getSum() {
          this.sum = this.number1 + this.number2
        }
      }
    }).mount("#app")
  </script>
</body>
</html>